package br.mikhas.container.config;

public class ResourceReferenceDependency extends UnresolvedDependency {

	/**
	 * The name of the referenced resource
	 */
	private String reference;

	/**
	 * Creates a new instance of {@link Dependency}
	 * 
	 * @param type
	 *            The java type of this dependency
	 * @param destiny
	 *            The {@link DependencyTarget} of this dependency
	 */
	public ResourceReferenceDependency(Class<?> type, DependencyTarget destiny) {
		super(type, destiny);
	}

	/**
	 * Returns the name of the resource which fulfills this dependency
	 * 
	 * @return The name of the resource
	 */
	public String getReferenceName() {
		return this.reference;
	}

	/**
	 * Sets the name of the referenced resource which will suply this
	 * dependency.
	 * 
	 * @param name
	 *            The name of the resource
	 */
	public void setReferenceName(String name) {
		this.reference = name;
	}

	@Override
	public String toString() {
		return "ReferenceDependency [reference=" + reference + ", type=" + type
				+ ", required=" + required + "]";
	}

}
